import request from '@/utils/request'

/** ****************************钓场列表*******************************************/

export function getFishingList(data) {
  return request({
    url: '/v1/fishGround/getFishGroundInfo',
    method: 'GET',
    params: data
  })
}
export function addFishingList(data) {
  return request({
    url: '/v1/fishery',
    method: 'POST',
    data: data
  })
}
export function editorFishingList(data) {
  return request({
    url: '/v1/fishery',
    method: 'PUT',
    data: data
  })
}
export function delFishingList(data) {
  return request({
    url: '/v1/fishery?ids=' + data,
    method: 'DELETE'
  })
}
export function searchFishingList(data) {
  return request({
    url: '/v1/fishery?current=' + data.current + '&size=' + data.size + '&advertName=' + data.advertName + '&type=' + data.type,
    method: 'GET'
  })
}

/** ****************************一级评论*******************************************/
export function getFishoneList(data) {
  let url = ''
  if (data.artId === undefined) {
    url = '/v1/fisheryComment/selectCommentByArtId?current=' + data.current + '&size=' + data.size + '&pid=' + data.pid
  } else {
    url = '/v1/fisheryComment/selectCommentByArtId?current=' + data.current + '&size=' + data.size + '&pid=' + data.pid + '&artId=' + data.artId
  }
  return request({
    url: url,
    method: 'GET'
  })
}
export function editorFishoneList(data) {
  return request({
    url: '/v1/fisheryComment',
    method: 'PUT',
    data: data
  })
}
export function delFishoneList(data) {
  return request({
    url: '/v1/fisheryComment?ids=' + data,
    method: 'DELETE'
  })
}
